<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use app\Models\ArticleToTag;

class Tag extends Model
{
    use HasFactory;

    protected $table = 'tags';

    public function articles()
    {
        return $this->belongsToMany(Article::class, 'article_to_tag', 'tag_id', 'article_id');
        //return $this->belongsToMany(Article::class, ArticleToTag::class);
    }
}
